-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (28 loc) · 877 Bytes
/
main.py
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
#!/usr/bin/env python
import sys
from euclid import Vector3
import pyglet
# TODO: Is there a better place to put this stuff?
if 'nogldebug' in sys.argv:
pyglet.options['debug_gl'] = False
from game.renderer import GameWindow3d
from game.states import MainMenuState
def main():
"""Run the game."""
window = GameWindow3d(MainMenuState, resizable=True)
# TODO: camera should be set in the state
window.camera.position = Vector3(8, 0, 4)
window.camera.looking_at = window.gamestate.board.position
pyglet.app.run()
if __name__ == "__main__":
if 'profile' in sys.argv:
import cProfile
import pstats
profiler = cProfile.Profile()
profiler.enable()
main()
profiler.disable()
stats = pstats.Stats(profiler)
stats.strip_dirs().sort_stats('time').print_stats(20)
else:
main()