From 03afd42fdcd52e4a827016828c4ad286de320078 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Thu, 31 Aug 2023 22:47:58 +0200 Subject: Updated 5 files, added 2 files and deleted 337 files (automated) --- src/game.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/game.py') diff --git a/src/game.py b/src/game.py index 209f896..be1659e 100644 --- a/src/game.py +++ b/src/game.py @@ -5,7 +5,7 @@ import audio import zoom as zoom_util import display -def run(screen): +def run(screen, blocks): canvas = pygame.Surface((1280, 720)) running = True zoom = (1280.0, 720.0) @@ -14,11 +14,6 @@ def run(screen): block_coordinates = (-1, -1) need_update_world = True world = pygame.Surface((1280, 720)) - blocks = [] - - for i in range(20): - for j in range(20): - blocks.append((802 + j * 21 - i * 42, 202 + j * 13 + i, "grass_block")) while running: audio.play_music() @@ -58,6 +53,10 @@ def run(screen): if not need_update_world: audio.play_sfx("none") if event.type == pygame.KEYDOWN: + if event.key == pygame.K_ESCAPE: + import menu + menu.show(screen) + return if event.key == pygame.K_w or event.key == pygame.K_z: offset = zoom_util.offset_up(offset) if event.key == pygame.K_s: -- cgit