summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/main.py b/main.py
index 6deda5a..2b06d03 100644
--- a/main.py
+++ b/main.py
@@ -2,6 +2,7 @@ from os import environ
environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'
import traceback
+import datetime
import os
os.chdir(os.path.dirname(os.path.realpath(__file__)))
@@ -10,14 +11,15 @@ import pygame
import sys
sys.path.append("./src")
-from src import audio, window, loader, menu
+from src import audio, window, loader, menu, helper
+helper.get_data_path()
pygame.font.init()
pygame.init()
window.init()
clock = pygame.time.Clock()
-screen = pygame.display.set_mode((1280, 720), pygame.RESIZABLE)
+screen = pygame.display.set_mode((1280, 720), pygame.RESIZABLE, vsync=True)
running = True
index = 0
@@ -79,6 +81,12 @@ while running:
print(traceback.format_exc())
+ try:
+ with open(helper.get_data_path() + "/crash_reports/" + datetime.datetime.now().isoformat().replace(":", "-") + ".txt", "w") as f:
+ f.write(traceback.format_exc())
+ except Exception:
+ print(traceback.format_exc())
+
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT: