22 lines
712 B
Python
22 lines
712 B
Python
import pygame
|
|
from pygame.locals import *
|
|
from Environment import Environment
|
|
from Global_variables import Global_variables as G_var
|
|
|
|
|
|
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)
|
|
|
|
def run(self):
|
|
running = True
|
|
while running:
|
|
for event in pygame.event.get(): # integrating with keyboard
|
|
if event.type == QUIT:
|
|
running = False
|
|
self.environment.update_all_elements(event)
|
|
self.environment.draw_all_elements()
|