Commit 1a182fc9 by BellCodeEditor

save project

parent 85abfafb
Showing with 10 additions and 10 deletions
...@@ -22,19 +22,19 @@ while True: ...@@ -22,19 +22,19 @@ while True:
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
if event.type==locals.KEYDOWN: if event.type==locals.KEYDOWN:
if event.key=locals.KEY_LEFT: if event.key==locals.K_LEFT:
if b[0]>1: if b[1]>1:
b[0]-=1 b[1]-=1
if event.key=locals.KEY_RIGHT: if event.key==locals.K_RIGHT:
if b[0]<15: if b[1]<15:
b[0]+=1
if event.key=locals.KEY_DOWN:
if b[1]<25:
b[1]+=1 b[1]+=1
if event.key==locals.K_DOWN:
if b[0]<25:
b[0]+=1
# 将背景图画上去 # 将背景图画上去
screen.blit(background,(0,0)) screen.blit(background,(0,0))
pygame.draw.rect(screen,(255,0,0),(a[0]*20-20,a[1]*20-20,20,20),0) pygame.draw.rect(screen,(255,0,0),(b[1]*20-20,b[0]*20-20,20,20),0)
pygame.draw.rect(screen,(255,255,255),(120,20,20,20),1) pygame.draw.rect(screen,(255,255,255),(b[1]*20-20,b[0]*20-20,20,20),1)
# 得分 # 得分
screen.blit(a,(350,50)) screen.blit(a,(350,50))
# 刷新画面 # 刷新画面
......
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