summaryrefslogtreecommitdiff
path: root/src/sliceitoff/__main__.py
blob: 4e5a6269737e88e66fcd981035d62f053ea87cd0 (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
""" Slice It Off! - Game where you slice the area where enemies reside to
    the minimum
"""

from time import sleep
from pathlib import Path

import pygame

from display import Display
from images import Images, Fonts
from game import Level
from stats import Stats


def sliceitoff():
    """ The game - It all starts here """
    pygame.init()
    
    pygame.mouse.set_visible(False)

    display = Display()
    current_path = Path(__file__).parent.resolve()
    Images.load_images( current_path )
    Fonts.load_fonts( current_path )

    clock = pygame.time.Clock()
    dt = 0

    Stats.new_game()
    
    while Stats.lives:
        level = Level(display = display)
        while level.step(dt):
            dt = clock.tick()

    pygame.quit()

sliceitoff()