Commit d3d0dc93 by BellCodeEditor

save project

parent 03de0303
Showing with 6 additions and 5 deletions
......@@ -16,7 +16,8 @@ FPS = 30
background = pygame.image.load('bg.png')
font = pygame.font.Font('STKAITI.TTF', 60) # 字体
center = [2,7]
center = [2,8]
rurrent_shape = [(0,0),(0,-1),(0,1),(-1,0)]
while True:
for event in pygame.event.get():
......@@ -32,10 +33,9 @@ while True:
# 得分
score_text = font.render(str(score),True,(0,0,0))
screen.blit(score_text,(350,70))
pygame.draw.rect(screen,(255,0,0),(20*center[1]-20,20*center[0]-20,20,20),0)
pygame.draw.rect(screen,(255,255,255),(20*center[1]-20,20*center[0]-20,20,20),1)
for i in rurrent_shape:
pygame.draw.rect(screen,(255,0,0),(20*(center[1] + i[1])-20,20*(center[0] + i[0])-20,20,20),0)
pygame.draw.rect(screen,(255,255,255),(20*(center[1] + i[1])-20,20*(center[0] + i[0])-20,20,20),1)
# 刷新画面
pygame.display.update()
clock.tick(FPS)
\ No newline at end of file
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