Commit 783800a2 by BellCodeEditor

save project

parent 820b8763
Showing with 9 additions and 3 deletions
...@@ -29,8 +29,14 @@ while True: ...@@ -29,8 +29,14 @@ while True:
shi="up" shi="up"
if event.key==locals.K_DOWN and shi != "up": if event.key==locals.K_DOWN and shi != "up":
shi="down" shi="down"
if shi=="right":
x+=30 x+=30
elif shi=="left":
x-=30
elif shi=="up":
y-=30
else:
y+=30
pst.append((x,y)) pst.append((x,y))
pst.pop(0) pst.pop(0)
# 将背景图画上去 # 将背景图画上去
...@@ -45,4 +51,4 @@ while True: ...@@ -45,4 +51,4 @@ while True:
screen.blit(food, (360, 300)) screen.blit(food, (360, 300))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(3) FPS.tick(6)
\ No newline at end of file \ 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