Commit 05109ebb by BellCodeEditor

auto save

parent 9a9a9730
Showing with 7 additions and 3 deletions
...@@ -29,7 +29,10 @@ position = [(180, 90), (180, 120), (210, 120), (x, y)] ...@@ -29,7 +29,10 @@ position = [(180, 90), (180, 120), (210, 120), (x, y)]
setheading = "right" setheading = "right"
snake_head = right snake_head = right
while True: applex=240
apple_y=180
while True:apple_y=180
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
...@@ -58,6 +61,8 @@ while True: ...@@ -58,6 +61,8 @@ while True:
else: else:
y += 30 y += 30
position.append((x, y)) position.append((x, y))
# 将背景图画上去 # 将背景图画上去
if a_x ==x and a_y ==y: if a_x ==x and a_y ==y:
a1=random.randint(0,21) a1=random.randint(0,21)
...@@ -83,4 +88,4 @@ while True: ...@@ -83,4 +88,4 @@ while True:
text=my_font.render(info,True,(0,0,0)) text=my_font.render(info,True,(0,0,0))
screen.blit(text,(540,0)) screen.blit(text,(540,0))
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(3) FPSCLOCK.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