Commit 193886ca by BellCodeEditor

save project

parent 46b84d65
Showing with 3 additions and 1 deletions
...@@ -54,7 +54,7 @@ color = random.choice(cube_colors) ...@@ -54,7 +54,7 @@ color = random.choice(cube_colors)
def cheak(center): def cheak(center):
for cube in current_shape: for cube in current_shape:
cube=(cube[0]+center[0],cube[1]+center[1]) cube=(cube[0]+center[0],cube[1]+center[1])
if cube[0]<1 or cube[1]<1 or cube[0]>geid_mum_height\ if cube[0]<1 or cube[1]<1 or cube[0]>grid_num_height \
or cube[1]>grid_num_width: or cube[1]>grid_num_width:
return False return False
...@@ -69,6 +69,8 @@ while True: ...@@ -69,6 +69,8 @@ while True:
elif event.key == locals.K_LEFT: # 向左 elif event.key == locals.K_LEFT: # 向左
if center[1] > 1: if center[1] > 1:
center[1] -= 1 center[1] -= 1
if cheak(center)==False:
center[1]=center[1]+1
elif event.key == locals.K_DOWN: # 向下 elif event.key == locals.K_DOWN: # 向下
if center[0] < 25: if center[0] < 25:
center[0] += 1 center[0] += 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment