diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-16 15:11:12 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-16 15:11:12 +0200 |
commit | 3d1e8a068f98a32e0146d8e9ab58dea49fbb4c74 (patch) | |
tree | 013814df21967af7dc9dfb390fd6de9770799616 /src/sliceitoff/main.py | |
parent | 77d104cced553b8dfc9896cb456bd039807ed6c6 (diff) |
controls and gamelogic draft
Diffstat (limited to 'src/sliceitoff/main.py')
-rw-r--r-- | src/sliceitoff/main.py | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/sliceitoff/main.py b/src/sliceitoff/main.py index d4fb0bc..1e84d28 100644 --- a/src/sliceitoff/main.py +++ b/src/sliceitoff/main.py @@ -1,33 +1,41 @@ -from pygame import ( - init as pg_init, - quit as pg_quit) +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(): - pg_init() + pygame.init() display = Display() Images.load_images() status = Status() field = Field() - - field.slice(20_000, 20_000, True, 1_000) - field.slice(10_000, 20_000, False, 1_000) + player = Player(field = field) + game = Game(player=player) - display.update( - [ - status.get_sprites(), - field.get_sprites() - ]) + 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) - pg_quit() + pygame.quit() main() |