Commit a6f741f2 by BellCodeEditor

save project

parent e523cc61
Showing with 4 additions and 0 deletions
...@@ -18,6 +18,8 @@ while True: ...@@ -18,6 +18,8 @@ while True:
if event.type == locals.QUIT: if event.type == locals.QUIT:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
if x<0 or x>630 or y<0 or y>450:
exit()
x+=30 x+=30
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
...@@ -29,6 +31,7 @@ while True: ...@@ -29,6 +31,7 @@ while True:
screen.blit(body, (180, 90)) screen.blit(body, (180, 90))
# 将果实画上去 # 将果实画上去
screen.blit(food, (360, 300)) screen.blit(food, (360, 300))
sc
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
a=pygame.time.Clock();a.tick(3) a=pygame.time.Clock();a.tick(3)
\ 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