Improves file error handling
DONE if a file error raises, do not warmup pygame
This commit is contained in:
parent
ed5380376f
commit
f2be5fb874
13
main.py
13
main.py
|
@ -23,16 +23,17 @@ from conf import (
|
||||||
GAME_KEYS = [K_UP, K_DOWN, K_RIGHT, K_LEFT]
|
GAME_KEYS = [K_UP, K_DOWN, K_RIGHT, K_LEFT]
|
||||||
last_wait = False
|
last_wait = False
|
||||||
|
|
||||||
pygame.init()
|
|
||||||
WINDOW = pygame.display.set_mode(WIN_DIM)
|
|
||||||
pygame.display.set_caption(CAPTION)
|
|
||||||
WINDOW.blit(pygame.image.load(BACKGRND_FILE).convert(), (0, HEAD_SIZE_H))
|
|
||||||
|
|
||||||
# Loading map
|
# Loading map
|
||||||
MAP_GAME = Map(MAP_FILE)
|
MAP_GAME = Map(MAP_FILE)
|
||||||
|
|
||||||
|
if MAP_GAME.status:
|
||||||
|
pygame.init()
|
||||||
|
pygame.time.Clock().tick(25)
|
||||||
|
WINDOW = pygame.display.set_mode(WIN_DIM)
|
||||||
|
pygame.display.set_caption(CAPTION)
|
||||||
|
WINDOW.blit(pygame.image.load(BACKGRND_FILE).convert(), (0, HEAD_SIZE_H))
|
||||||
|
|
||||||
# Game loop
|
# Game loop
|
||||||
pygame.time.Clock().tick(25)
|
|
||||||
while MAP_GAME.status:
|
while MAP_GAME.status:
|
||||||
last_wait = True
|
last_wait = True
|
||||||
set_header(WINDOW, MAP_GAME.status_message)
|
set_header(WINDOW, MAP_GAME.status_message)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user