summaryrefslogtreecommitdiff
path: root/src/game.py
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-08-31 22:47:58 +0200
committerRaindropsSys <contact@minteck.org>2023-08-31 22:47:58 +0200
commit03afd42fdcd52e4a827016828c4ad286de320078 (patch)
tree0cb77209fdb1d4d192afa2ac6d6c3ada0074661b /src/game.py
parente54ac640f1d3f7071a48032e924b04529cbd358f (diff)
downloadblocks-03afd42fdcd52e4a827016828c4ad286de320078.tar.gz
blocks-03afd42fdcd52e4a827016828c4ad286de320078.tar.bz2
blocks-03afd42fdcd52e4a827016828c4ad286de320078.zip
Updated 5 files, added 2 files and deleted 337 files (automated)
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: