summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-09-01 14:54:08 +0200
committerRaindropsSys <contact@minteck.org>2023-09-01 14:54:08 +0200
commitc2f1ed6a85c3895483d36af0f64e2829c3fa3263 (patch)
tree6f6a8efbe62db8576a1abf5409569b37ccf261be /main.py
parent03afd42fdcd52e4a827016828c4ad286de320078 (diff)
downloadblocks-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.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: