Commit 83a43166 by BellCodeEditor

save project

parent b0ecfffc
Showing with 11 additions and 0 deletions
......@@ -46,6 +46,9 @@ cube_colors = [
center = [2, 8] # 第2行第8列
current_shape = [(0, -1), (0, 0), (0, 1), (-1, 0)]
shape = random.choice(shape_list)
index = random.randint(0,len(shape)-1) # 随机形状索引
current_shape = shape[index]
while True:
for event in pygame.event.get():
......@@ -62,8 +65,16 @@ while True:
if center[0] < 25:
event.key == locals.
elif event.key == locals.K_DOWN: #向下
elif event. key == locals.DOWN:
center[0] = center[0] + 1
if check(center) == False: #向下
center[0] = center[0] + 1
if check(center) == False:
center[0] = center[0] - 1
elif event. key == locals.K_UP #向上键
index += 1
# 将背景图画上去
......
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