summaryrefslogtreecommitdiff
path: root/src/menu.py
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-09-02 15:32:03 +0200
committerRaindropsSys <contact@minteck.org>2023-09-02 15:32:03 +0200
commit6a20ab31ef4d9f6bb0e008b9f1b8d3fbeb6bd956 (patch)
treed425cdef328ed268fb149d6e2b139c9b2c26dbd2 /src/menu.py
parentc2f1ed6a85c3895483d36af0f64e2829c3fa3263 (diff)
downloadblocks-6a20ab31ef4d9f6bb0e008b9f1b8d3fbeb6bd956.tar.gz
blocks-6a20ab31ef4d9f6bb0e008b9f1b8d3fbeb6bd956.tar.bz2
blocks-6a20ab31ef4d9f6bb0e008b9f1b8d3fbeb6bd956.zip
Updated 13 files and added 2 files (automated)
Diffstat (limited to 'src/menu.py')
-rw-r--r--src/menu.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/menu.py b/src/menu.py
index 95147df..1b877ac 100644
--- a/src/menu.py
+++ b/src/menu.py
@@ -51,6 +51,8 @@ def show(screen):
if event.key == pygame.K_ESCAPE:
run = False
elif event.key == pygame.K_RETURN:
+ text = text.strip()
+
for i in ["con", "prn", "aux", "nul",
"com1", "com2", "com3", "com4", "com5", "com6", "com7", "com8", "com9",
"lpt1", "lpt2", "lpt3", "lpt4", "lpt5", "lpt6", "lpt7", "lpt8", "lpt9"]:
@@ -90,15 +92,10 @@ def show(screen):
screen.blit(scaled_win, (screen.get_size()[0] / 2 - width / 2, screen.get_size()[1] / 2 - height / 2))
pygame.display.flip()
- world_map = [[["grass_block" for _ in range(20)] for _ in range(20)]]
-
- for _ in range(9):
- world_map.append([["air" for _ in range(20)] for _ in range(20)])
-
audio.wait_for_sfx()
import game
- game.run(screen, world_map, helper.get_data_path() + "/saves/" + text)
+ game.run(screen, helper.get_data_path() + "/saves/" + text)
return
else:
@@ -159,6 +156,8 @@ def show(screen):
canvas.blit(helper.text("Notice:", 20, (255, 255, 255)), (50, 75 + (25 * (last_i + 2))))
canvas.blit(helper.text("Worlds from Blocks 0.1a are not compatible and", 20, (255, 255, 255)), (75, 75 + (25 * (last_i + 3))))
canvas.blit(helper.text("do not show up here.", 20, (255, 255, 255)), (75, 75 + (25 * (last_i + 4))))
+ canvas.blit(helper.text("Worlds from Blocks 0.2a are not compatible and", 20, (255, 255, 255)), (75, 75 + (25 * (last_i + 5))))
+ canvas.blit(helper.text("will crash the game.", 20, (255, 255, 255)), (75, 75 + (25 * (last_i + 6))))
scaled_win = pygame.transform.scale(canvas, (width, height))
screen.blit(scaled_win, (screen.get_size()[0] / 2 - width / 2, screen.get_size()[1] / 2 - height / 2))
@@ -184,7 +183,7 @@ def show(screen):
audio.wait_for_sfx()
import game
- game.run(screen, loaded['blocks'], helper.get_data_path() + "/saves/" + world_name)
+ game.run(screen, helper.get_data_path() + "/saves/" + world_name)
return
else: