AIprojekt-wozek/Program.py

22 lines
712 B
Python
Raw Normal View History

2022-03-24 20:02:21 +01:00
import pygame
from pygame.locals import *
from Environment import Environment
from Global_variables import Global_variables as G_var
2022-03-24 20:02:21 +01:00
class Program:
def __init__(self):
pygame.init()
self.window = pygame.display.set_mode(
(G_var().WINDOW_X, G_var().WINDOW_Y)) # decides window's size
self.environment = Environment(self.window)
2022-03-24 20:02:21 +01:00
def run(self):
running = True
while running:
for event in pygame.event.get(): # integrating with keyboard
if event.type == QUIT:
2022-03-24 20:02:21 +01:00
running = False
self.environment.update_all_elements(event)
self.environment.draw_all_elements()