Commit d8c93a3c by BellCodeEditor

save project

parent fa64b59c
Showing with 7 additions and 6 deletions
......@@ -3,8 +3,9 @@ from pygame import locals
# 初始化pygame,为使用硬件做准备
pygame.init()
x == 240
y == 120
fps_clock = pygame.time.Clock()
x = 240
y = 120
# 创建一个窗口
screen = pygame.display.set_mode((660, 480))
......@@ -19,9 +20,8 @@ while True:
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
while True:
x+30=x
x +=30
# 将背景图画上去
screen.blit(background, (0, 0))
# 将贪吃蛇画上去
......@@ -33,4 +33,5 @@ while True:
# 将果实画上去
screen.blit(food, (360, 300))
# 刷新画面
pygame.display.update()
\ No newline at end of file
pygame.display.update()
fps_clock.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