Skip to content

Commit c4458e0

Browse files
author
cent5
committed
Week 2 - 5: (last checkpoint) support replay
1 parent 8a7e473 commit c4458e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
break
2121

2222
world.update()
23+
if not world.status.is_running():
24+
# Kiểm tra xem người chơi có chọn nhấn ENTER để replay
25+
pressed = pygame.key.get_pressed()
26+
if pressed[pygame.K_RETURN]:
27+
world = World(screen)
28+
2329
world.render()
2430
pygame.display.flip()
2531
clock.tick(FPS)

0 commit comments

Comments
 (0)