From 5a50cd93de8cb94154777e2da8f1bbca86479199 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sun, 3 Sep 2023 22:38:14 +0200 Subject: Updated 4 files and added 5 files (automated) --- src/game.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/game.py') diff --git a/src/game.py b/src/game.py index 82330b7..611d5b1 100644 --- a/src/game.py +++ b/src/game.py @@ -106,6 +106,15 @@ def run(screen, save_data): audio.play_sfx(block_list[selected_block]['sounds'][0]) chunk[screen_blocks[i][3] + 1][screen_blocks[i][6]][screen_blocks[i][7]] = selected_block need_update_world = True + else: + print("Cannot place block at " + str(screen_blocks[i][6]) + ", " + str(screen_blocks[i][3] + 1) + ", " + str(screen_blocks[i][7])) + + if not (len(chunk) - 1 >= screen_blocks[i][3] + 1): + print(" => No layer available") + elif not (chunk[screen_blocks[i][3] + 1][screen_blocks[i][7]][screen_blocks[i][6]] == "air"): + print(" => Above layer obstructed, has " + chunk[screen_blocks[i][3] + 1][screen_blocks[i][7]][screen_blocks[i][6]]) + elif not (chunk[screen_blocks[i][3] + 1][screen_blocks[i][6]][screen_blocks[i][7]] != selected_block): + print(" => No change to make") break elif right: -- cgit