summaryrefslogtreecommitdiff
path: root/src/game.py
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-09-03 22:38:14 +0200
committerRaindropsSys <contact@minteck.org>2023-09-03 22:38:14 +0200
commit5a50cd93de8cb94154777e2da8f1bbca86479199 (patch)
tree74c427061e5f23bc709b8c976b1bf559666cc04e /src/game.py
parent153d21ace9801ac665e2d7f99c967147d1214f29 (diff)
downloadblocks-5a50cd93de8cb94154777e2da8f1bbca86479199.tar.gz
blocks-5a50cd93de8cb94154777e2da8f1bbca86479199.tar.bz2
blocks-5a50cd93de8cb94154777e2da8f1bbca86479199.zip
Updated 4 files and added 5 files (automated)
Diffstat (limited to 'src/game.py')
-rw-r--r--src/game.py9
1 files changed, 9 insertions, 0 deletions
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: