diff options
author | RaindropsSys <contact@minteck.org> | 2023-09-01 14:54:08 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-09-01 14:54:08 +0200 |
commit | c2f1ed6a85c3895483d36af0f64e2829c3fa3263 (patch) | |
tree | 6f6a8efbe62db8576a1abf5409569b37ccf261be /main.py | |
parent | 03afd42fdcd52e4a827016828c4ad286de320078 (diff) | |
download | blocks-c2f1ed6a85c3895483d36af0f64e2829c3fa3263.tar.gz blocks-c2f1ed6a85c3895483d36af0f64e2829c3fa3263.tar.bz2 blocks-c2f1ed6a85c3895483d36af0f64e2829c3fa3263.zip |
Updated 11 files and added 2 files (automated)
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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: |