Fallback to arcade.Window on Linux to avoid exception

This commit is contained in:
Brandon Corfman
2025-11-01 11:41:43 -04:00
parent 189e345f1f
commit 88a699bbcd

6
run.py
View File

@@ -76,7 +76,11 @@ else:
if settings.get("music", True): if settings.get("music", True):
theme_sound.play(volume=settings.get("music_volume", 50) / 100, loop=True) theme_sound.play(volume=settings.get("music_volume", 50) / 100, loop=True)
window = ControllerWindow(width=resolution[0], height=resolution[1], title='Game Of Life', samples=antialiasing, antialiasing=antialiasing > 0, fullscreen=fullscreen, vsync=vsync, resizable=False, style=style) try:
window = ControllerWindow(width=resolution[0], height=resolution[1], title='Game Of Life', samples=antialiasing, antialiasing=antialiasing > 0, fullscreen=fullscreen, vsync=vsync, resizable=False, style=style)
except (FileNotFoundError, PermissionError) as e:
logging.warning(f"Controller support unavailable: {e}. Falling back to regular window.")
window = arcade.Window(width=resolution[0], height=resolution[1], title='Game Of Life', samples=antialiasing, antialiasing=antialiasing > 0, fullscreen=fullscreen, vsync=vsync, resizable=False, style=style)
if vsync: if vsync:
window.set_vsync(True) window.set_vsync(True)