Commit f1090a8b by BellCodeEditor

auto save

parent d5739bd2
Showing with 7 additions and 0 deletions
import pygame
import random
from pygame import locals
# 初始化pygame,为使用硬件做准备
......@@ -51,6 +52,10 @@ while True:
y -= 30
else:
y += 30
pos.pop
if food_x==x and food_y==y:
food_x=30*randon.randing(0,21)
food_y=30*randon.randing(0,15)
position.append((x, y))
position.pop(0)
# 将背景图画上去
......@@ -66,3 +71,4 @@ while True:
# 刷新画面
pygame.display.update()
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