summaryrefslogtreecommitdiff
path: root/src/game.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.py')
-rw-r--r--src/game.py11
1 files changed, 5 insertions, 6 deletions
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: