Commit 6f432fc2 by BellCodeEditor

auto save

parent c8068f92
Showing with 6 additions and 8 deletions
......@@ -39,7 +39,6 @@ L = [[(-1, 0), (0, 0), (1, 0), (1, 1)],
[(0, -1), (0, 0), (0, 1), (1, -1)],
[(-1, 0), (0, 0), (1, 0), (-1, -1)],
[(0, -1), (0, 0), (0, 1), (-1, 1)]
SB = []
shape_list = [I, J, L, O, S, T, Z] # 7种类型俄罗斯方块
......@@ -49,13 +48,10 @@ cube_colors = [
(255, 204, 0), (204, 0, 51),(255, 0, 51), (0, 102, 153),
(153, 0, 51), (204, 255, 102), (255, 153, 0)]
center = [2, 8] # 第2行第8列
current_shape =[]
shape=random.choice(shape_list)
index=random.randint(0,len(shape)+ -1)
current_shape=shape[index]
color =random.choice(cube_colors)
d = []
for i in range(25):
d.append([0]*15)
while True:
for event in pygame.event.get():
......@@ -81,11 +77,13 @@ while True:
color =random.choice(cube_colors)
a += 1
if a % FPS:
if a % FPS==0:
center[0] += 1
if check(center) == False:
center[0] -= 1
s = False
for cube in current_pos:
d[cube[0]-1][cube[1]-1]=color
# 将背景图画上去
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