summaryrefslogtreecommitdiff
path: root/src/sliceitoff/main.py
blob: 1e84d28c67c0c7fdb56e64c73714cc488a094b31 (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
35
36
37
38
39
40
41
import pygame
    
from time import sleep
    
from display import Display
from status import Status
from player import Player
from field import Field
from images import Images
from game import Game


def main():
    pygame.init()

    display = Display()
    Images.load_images()

    status = Status()
    field = Field()
    player = Player(field = field)
    game = Game(player=player)
    
    clock = pygame.time.Clock()

    for _ in range(600):
        if game.step():
            break
        display.update(
                [
                    status.get_sprites(),
                    field.get_sprites(),
                    player.get_sprites()
                ])
        clock.tick(60)
        

    sleep(2)
    pygame.quit()

main()