Commit e0963d3a by BellCodeEditor

save project

parent 73396462
Showing with 24 additions and 0 deletions
...@@ -50,6 +50,8 @@ shape=random.choice(shape_list) ...@@ -50,6 +50,8 @@ shape=random.choice(shape_list)
index=random.randint(0,len(shape)-1) index=random.randint(0,len(shape)-1)
fx=shape[index] fx=shape[index]
color=random.choice(cube_colors) color=random.choice(cube_colors)
count = 0
new_a = False
def check(center): def check(center):
for cube in fx: for cube in fx:
...@@ -74,6 +76,28 @@ while True: ...@@ -74,6 +76,28 @@ 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
fx=shape[index]
if check(center) == False:
index=old_index
fx = shape[index]
count += 1
if count % FPS == 0:
center[0] += 1
if check(center) == False:
center[0] -= 1
new_a = False
if new_a == False:
center = [2, 8] # 第2行第8列
shape=random.choice(shape_list)
index=random.randint(0,len(shape)-1)
fx=shape[index]
color=random.choice(cube_colors)
new_a = True
# 将背景图画上去 # 将背景图画上去
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