Commit 4f090b0f by BellCodeEditor

save project

parent e2baae2e
Showing with 5 additions and 2 deletions
...@@ -49,7 +49,6 @@ cube_index=random.randint(0,len(cube_list)-1) ...@@ -49,7 +49,6 @@ cube_index=random.randint(0,len(cube_list)-1)
color=random.choice(cube_colors) color=random.choice(cube_colors)
current_pos = [] current_pos = []
def check(current_pos,o): def check(current_pos,o):
print(current_pos)
for i in current_pos: for i in current_pos:
if (i[1]<=1 and o==1)or(i[1]>=15 and o==2): if (i[1]<=1 and o==1)or(i[1]>=15 and o==2):
return True return True
...@@ -74,7 +73,11 @@ while True: ...@@ -74,7 +73,11 @@ while True:
elif event.key==locals.K_UP: elif event.key==locals.K_UP:
cube_index+=1 cube_index+=1
cube_index%=len(cube_list) cube_index%=len(cube_list)
print(cube_list[cube_index]) if center[1]>7:
if check(current_pos,2):
center[1] -= 1
elif check(current_pos,1):
center[1] += 1
# 将背景图画上去 # 将背景图画上去
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