Commit 9cd87c68 by BellCodeEditor

save project

parent 19e8f5f3
Showing with 14 additions and 2 deletions
...@@ -52,8 +52,9 @@ def check(center): ...@@ -52,8 +52,9 @@ def check(center):
return False return False
center = [4, 8] # 第2行第8列 center = [4, 8] # 第2行第8列
current_shape =random.choice(shape_list) shape=random.choice(shape_list)
current_shape=random.choice(current_shape) index=random.randint(0,len(shape)-1)
current_shape=shape
color=random.choice(cube_colors) color=random.choice(cube_colors)
while True: while True:
...@@ -78,6 +79,17 @@ while True: ...@@ -78,6 +79,17 @@ while True:
center[0] += 1 center[0] += 1
if check(center)==False: if check(center)==False:
center[0]-=1 center[0]-=1
elif event.key==locals.k_up:
old_index=index
index+=1
if index>=len(shape):
index=0
current_shape=shape[index]
if check(center)==False:
index=old_index
current_shape=shape[index]
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
......
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