Commit d974c6a6 by BellCodeEditor

save project

parent 144251bc
Showing with 12 additions and 2 deletions
......@@ -30,4 +30,14 @@ while True:
screen.blit(food, (360, 300))
# 刷新画面
pygame.display.updade()
FPSCLOCK.tick(3)
\ No newline at end of file
FPSCLOCK.tick(3)
for event in pygame.event.get()
if event.type == locals.KEYDOWN:
if event.key == locals.K_RIGHT and setheading !="left":
setheading ='left'
if event.key == locals.K_LEFT and setheading !=:"right"
setheading ='right'
if event.key == locals.Kand setheading !="left":
setheading ='right'
if event.key == locals.K_RIGHT and setheading !="left":
setheading ='right'
\ 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