Commit 01639329 by BellCodeEditor

save project

parent 5fd3db08
Showing with 8 additions and 2 deletions
......@@ -14,6 +14,7 @@ clock = pygame.time.Clock() # pygame时钟,控制游æˆé€Ÿåº¦ï¼ˆå¸§æ•°ï¼‰# è½
bg = pygame.image.load('bg.png')
font = pygame.font.Font('STKAITI.TTF', 60) # 字体
center = [2,8]
T = [(0,-1),(0,0),(0,1),(-1,0)]
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -29,8 +30,13 @@ while True:
if center[0] < 25:
center[0] += 1# 将背景图画上去
screen.blit(bg,(0,0))
pygame.draw.rect(screen,(255,0,0),(center[1]*20-20,center[0]*20-20,20,20),0)
pygame.draw.rect(screen,(255,255,255),(center[1]*20-20,center[0]*20-20,20,20),1)# 得分
T_pos = []
for fk in T:
pos = (center[0] + fk[0],center[1] + fk[1])
T_pos.append(pos)
for ef in T_pos:
pygame.draw.rect(screen,(255,0,0),(ef[1]*20-20,ef[0]*20-20,20,20),0)
pygame.draw.rect(screen,(255,255,255),(ef[1]*20-20,ef[0]*20-20,20,20),1)# 得分
scoret = font.render(str(score),True,(0,0,0))
screen.blit(scoret,(350,60))# 刷新画面
pygame.display.update()
......
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