blob: dadc8977a057cf8b777aa2123b9415666907fba5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import pygame.time
from setup import *
from game import Game
dimensions = (SCREEN_WIDTH, SCREEN_HEIGHT)
window = pygame.display.set_mode(dimensions)
pygame.display.set_caption("Game")
icon = pygame.image.load('textures/logo.png')
pygame.display.set_icon(icon)
game = Game()
previous_time = pygame.time.get_ticks()
running = True
while running:
current_time = pygame.time.get_ticks()
delta_time = current_time - previous_time
previous_time = current_time
window.fill((255, 255, 255))
status = game.update(delta_time)
game.draw(window)
pygame.display.update()
if status == COMMAND_EXIT:
running = False
pygame.quit()
|