DSZI_Survival/src/game/Game.py

29 lines
665 B
Python
Raw Normal View History

2020-04-02 15:50:47 +02:00
import pygame
import json
from pathlib import Path
2020-03-31 21:47:09 +02:00
class Game:
def __init__(self):
2020-04-02 15:50:47 +02:00
print("Loading configuration...", end=" ")
try:
configFolder = Path("../../data/config/")
configFile = configFolder / "mainConfig.json"
self.config = json.loads(configFile.read_text())
print("OK")
except IOError:
print("Error reading configuration file. Exiting...")
exit(1)
print("Initializing pygame...", end=" ")
pygame.init()
print("OK")
print("Initializing screen, params: " + str(self.config["window"]) + "...", end=" ")
game = Game()