Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/sprites/background/intro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ def main():
"""Main function of this game"""

screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption("Moje Střilečka")
pygame.display.set_caption("UNICORN ZOMBIES")

show_splash(screen)

while True:
choice = show_menu(screen)

#print("Choice", choice)

if choice == GameType.SINGLE:
game = SingleGame(screen=screen)
result = game.run()
Expand Down
22 changes: 9 additions & 13 deletions ui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""UI module"""
import os

import pygame
from decorators import log_decorator
Expand All @@ -14,7 +15,7 @@ def show_menu(screen):
"ESC: Ukončení"]

while True:
screen.fill((0, 0, 128))
screen.fill((43, 28, 88))
for i, option in enumerate(menu_options):
text = font.render(option, True, (255, 255, 255))
screen.blit(text, (50, 200 + i * 40))
Expand All @@ -39,25 +40,20 @@ def show_menu(screen):
def show_splash(screen):
"""Init splash screen"""

font = pygame.font.Font(None, 36)

# todo timer, aby se po par sekundach samo ukoncilo
while True:
screen.fill((0, 0, 0))

text = font.render("Our fancy game name", True, (255, 0, 0))
screen.blit(text, (50, 200))
bg_path = os.path.join("assets", "sprites", "background", "intro.png")
background = pygame.image.load(bg_path).convert()
background = pygame.transform.scale(background, screen.get_size())

text = font.render("press escape to continue", True, (255, 255, 255))
screen.blit(text, (50, 300))
screen.blit(background, (0, 0))
pygame.display.flip()

pygame.display.flip()
while True:

for event in pygame.event.get():
if event.type == pygame.QUIT:
return

if event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE:
if event.type == pygame.KEYDOWN and event.key == pygame.K_RETURN:
return

def show_end_message(screen, message):
Expand Down
Loading