-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentry_point.py
39 lines (27 loc) · 924 Bytes
/
entry_point.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
34
35
36
37
38
import traceback
import datetime
import os
import pathlib
import configs
import src.example.demogame
"""
The main entry point.
"""
game_class = src.example.demogame.DemoGame # <--- change this to your actual game class
def _dismiss_splash_screen():
try:
import pyi_splash # special pyinstaller thing - import will not resolve in dev
pyi_splash.close()
except Exception:
pass # this is expected to throw an exception in non-splash launch contexts.
if __name__ == "__main__":
_dismiss_splash_screen()
try:
import src.engine.gameloop as gameloop
loop = gameloop.create_instance(game_class())
loop.run()
except Exception as e:
if configs.do_crash_reporting:
import src.engine.crashreporting as crashreporting
crashreporting.write_crash_file(configs.name_of_game, configs.version, dest_dir="logs")
raise e