Commit 929705f0 by BellCodeEditor

save project

parent 656379d3
Showing with 3 additions and 3 deletions
...@@ -16,7 +16,7 @@ clock = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数) ...@@ -16,7 +16,7 @@ clock = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
background = pygame.image.load('bg.png') background = pygame.image.load('bg.png')
font = pygame.font.Font('STKAITI.TTF', 60) # 字体 font = pygame.font.Font('STKAITI.TTF', 60) # 字体
center=[3,8]#2是行,8是列 center=[3,8]#2是行,8是列
curr_shape=[(0,0),(0,1),(-1,0),(-2,0)] curr_shape=[(0,0),(0,1),(-1,0),(-2,0)]#表示一个“L”形
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -40,9 +40,9 @@ while True: ...@@ -40,9 +40,9 @@ while True:
curr_pas.append(aa) curr_pas.append(aa)
for pas in curr_pas: for pas in curr_pas:
pygame.draw.rect(screen,(194,34,134),(pas[1]*20-20,pas[0]*20-20,20,20),0) pygame.draw.rect(screen,(194,34,134),(pas[1]*20-20,pas[0]*20-20,20,20),0)
#***center[1]*20-20*是x坐标**表示他格子的列乘他的格子数因为是从左上角开始渲染所以要减20,_____center[0]*20-20__是y坐标__表示格子所在的行乘他的格子数因为是从左上角开始渲染所以要减20。得出来位置。 #***pas[1]*20-20*是x坐标**表示他格子的列乘他的格子数因为是从左上角开始渲染所以要减20,_____pas[0]*20-20__是y坐标__表示格子所在的行乘他的格子数因为是从左上角开始渲染所以要减20。得出来位置。
pygame.draw.rect(screen,(25,223,255),(pas[1]*20-20,pas[0]*20-20,20,20),1) pygame.draw.rect(screen,(25,223,255),(pas[1]*20-20,pas[0]*20-20,20,20),1)
#***center[1]*20-20*是x坐标**表示边框所在的列乘他的格子数因为是从左上角开始渲染所以要减20,___center[0]*20-20__是y坐标_表示边框所在的行乘他的格子数因为是从左上角开始渲染所以要减20。得出来位置。 #***pas[1]*20-20*是x坐标**表示边框所在的列乘他的格子数因为是从左上角开始渲染所以要减20,___pas[0]*20-20__是y坐标_表示边框所在的行乘他的格子数因为是从左上角开始渲染所以要减20。得出来位置。
# 得分 # 得分
score_text=font.render(str(score),True,(0,0,0)) score_text=font.render(str(score),True,(0,0,0))
screen.blit(score_text,(360,70)) screen.blit(score_text,(360,70))
......
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