Commit bb618511 by BellCodeEditor

save project

parent 17ef8a25
Showing with 11 additions and 1 deletions
...@@ -47,7 +47,8 @@ color=random.choice(cube_colors) ...@@ -47,7 +47,8 @@ color=random.choice(cube_colors)
center = [2, 8] # 第2行第8列 center = [2, 8] # 第2行第8列
current_shape = [(0, -1), (0, 0), (0, 1), (-1, 0)] current_shape = [(0, -1), (0, 0), (0, 1), (-1, 0)]
shape_x=random.choice(shape_list) shape_x=random.choice(shape_list)
current_shape=random.choice(shape_x) ID=random.randint(0,len(shape_x)-1)
current_shape=shape_x[ID]
def check(cuntret): def check(cuntret):
for i in current_shape: for i in current_shape:
i=(i[0]+cuntret[0],i[1]+cuntret[1]) i=(i[0]+cuntret[0],i[1]+cuntret[1])
...@@ -70,6 +71,15 @@ while True: ...@@ -70,6 +71,15 @@ 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_ID=ID
ID+=1
if ID>=len(shape_x):
ID=0
current_shape=shape_x[ID]
if check(center)==False:
ID=old_ID
current_shape=shape_x[ID]
# 将背景图画上去 # 将背景图画上去
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