mirror of
https://github.com/EDeev/pixel_gamble.git
synced 2026-06-16 21:21:03 +03:00
33 lines
833 B
Python
33 lines
833 B
Python
import pygame, sys
|
|
from data import *
|
|
from level import Level
|
|
|
|
|
|
class Game:
|
|
def __init__(self):
|
|
# ЗАПУСК ИГРЫ
|
|
pygame.init()
|
|
self.screen = pygame.display.set_mode((WIDTH, HEIGTH))
|
|
pygame.display.set_caption('Pixel Gamble')
|
|
self.clock = pygame.time.Clock()
|
|
|
|
self.level = Level() # ЗАГРУЗКА КАРТЫ
|
|
|
|
def run(self):
|
|
while True:
|
|
for event in pygame.event.get():
|
|
if event.type == pygame.QUIT:
|
|
pygame.quit()
|
|
sys.exit()
|
|
|
|
self.screen.fill('black')
|
|
|
|
self.level.run() # ОТРИСОВКА КАРТЫ
|
|
|
|
pygame.display.update()
|
|
self.clock.tick(FPS)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
game = Game()
|
|
game.run()
|