Commit 09b529a6 by BellCodeEditor

save project

parent 70c122ec
Showing with 5 additions and 5 deletions
......@@ -21,18 +21,18 @@ while True:
if event.type == locals.QUIT:
exit()
if event.type == locals.KEYDOWN:
if event.key==locals.K_w:
if event.key==locals.K_w and center[0] > 1:
center[0] -= 1
if event.key==locals.K_s:
if event.key==locals.K_s and center[0] < 25:
center[0] += 1
if event.key==locals.K_a:
if event.key==locals.K_a and center[1] > 1:
center[1] -= 1
if event.key==locals.K_d:
if event.key==locals.K_d and center[1] < 15:
center[1] += 1
# 将背景图画上去
screen.blit(background,(0,0))
#画出矩形
pygame.draw.rect(screen,(255,0,0),(center[1]*20,center[0]*20,20,20),0)
pygame.draw.rect(screen,(255,0,0),(center[1]*20-20,center[0]*20-20,20,20),0)
# 得分
myscore=font.render(str(score),True,(0,0,0))
screen.blit(myscore,(350,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