summaryrefslogtreecommitdiffstats
path: root/2048.py
blob: 7de3b9b1f4cfe934cf2f5d5fb48785b2ab759bb9 (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
from setup import *
from game import Game

# Set the dimensions of the screen
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))

scene = Game()

delta = 1000 // fps

# Main loop
is_running = True
while is_running:

    # Check if the window is closed
    if pygame.event.peek(pygame.QUIT):
        is_running = False

    scene.update(delta)
    scene.draw(screen)

    # Update the window and find delta
    pygame.display.update()
    delta = clock.tick(fps)

# Exit pygame
pygame.quit()