Update main

main
Filips Kalniņš 2026-02-11 06:27:04 +00:00
parent 8bef30be97
commit 77563ec709
1 changed files with 43 additions and 0 deletions

43
main
View File

@ -0,0 +1,43 @@
import sys
import pygame
from settings import *
from game import Game
def initialize_pygame():
pygame.init()
# Optional: control vsync if supported
flags = pygame.SCALED
if VSYNC:
flags |= pygame.DOUBLEBUF
screen = pygame.display.set_mode(
(SCREEN_WIDTH, SCREEN_HEIGHT),
flags
)
pygame.display.set_caption(GAME_TITLE)
return screen
def main():
try:
screen = initialize_pygame()
game = Game()
game.run()
except Exception as e:
print("An error occurred:")
print(e)
finally:
pygame.quit()
sys.exit()
if __name__ == "__main__":
main()