Refactor code
This commit is contained in:
parent
f06e0d5d47
commit
789be9c5d8
1 changed files with 2 additions and 4 deletions
4
main.py
4
main.py
|
@ -108,8 +108,8 @@ def main():
|
||||||
screen.blit(text, text_rect)
|
screen.blit(text, text_rect)
|
||||||
pygame.display.flip()
|
pygame.display.flip()
|
||||||
|
|
||||||
while True:
|
|
||||||
restart = False
|
restart = False
|
||||||
|
while not restart:
|
||||||
for event in pygame.event.get():
|
for event in pygame.event.get():
|
||||||
if event.type == pglocals.QUIT:
|
if event.type == pglocals.QUIT:
|
||||||
logger.info('Received QUIT event')
|
logger.info('Received QUIT event')
|
||||||
|
@ -119,8 +119,6 @@ def main():
|
||||||
if event.key == pglocals.K_r:
|
if event.key == pglocals.K_r:
|
||||||
logger.debug('Restarting game')
|
logger.debug('Restarting game')
|
||||||
restart = True
|
restart = True
|
||||||
if restart:
|
|
||||||
break
|
|
||||||
|
|
||||||
clock.tick(5)
|
clock.tick(5)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue