Commit 88dd9208 by BellCodeEditor

save project

parent 56d78b2c
Showing with 28 additions and 2 deletions
...@@ -8,6 +8,8 @@ grid_size = 20 # 格子大小 ...@@ -8,6 +8,8 @@ grid_size = 20 # 格子大小
grid_num_width = 15 # 横向格子数量 grid_num_width = 15 # 横向格子数量
grid_num_height = 25 # 纵向格子数量 grid_num_height = 25 # 纵向格子数量
FPS = 30 FPS = 30
fuck=0
fuckyou=False
# 创建窗口 # 创建窗口
screen = pygame.display.set_mode((460, 500)) screen = pygame.display.set_mode((460, 500))
...@@ -70,9 +72,33 @@ while True: ...@@ -70,9 +72,33 @@ while True:
if check(center)==False: if check(center)==False:
center[1] += 1 center[1] += 1
elif event.key == locals.K_DOWN: elif event.key == locals.K_DOWN:
center[0]+=1 # 向下 center[0]+=3 # 向下
if check(center)==False: if check(center)==False:
center[0] -= 1 center[0] -= 3
elif event.key == locals.K_UP:
old_cnm=index
index+=1
if index>= len(shape):
index=0
current_shape=shape[index]
if check(center)==False:
index=old_cnm
current_shape=shape[index]
if fuckyou==False:
fuckyou=True
center = [2, 8] # 第2行第8列
shape=random.choice(shape_list)
index=random.randint(0,len(shape)-1)
current_shape =shape[index]
color= random.choice(cube_colors)
fuck+=1
if fuck%FPS==0:
center[0]+=1
if check(center)==False:
center[0]-=1
fuckyou=False
# 将背景图画上去 # 将背景图画上去
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