Commit d21e0f56 by BellCodeEditor

save project

parent 447f9156
Showing with 20 additions and 2 deletions
......@@ -14,12 +14,29 @@ right = pygame.image.load('right.png')
food = pygame.image.load('apple.png')
body = pygame.image.load('body.png')
x,y=240,120
position=[(180,90)(180120),(210,120),(x,y)]
setheading="right"
snake_head=right
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
elif event.type==locals,KEYDOWN:
if event.key==locals.K_RIGHT and screen !=left
setheading="right"
snake_head=right
if event.key==locals.K_RIGHT and screen !=left
setheading="right"
snake_head=right
if event.key==locals.K_RIGHT and screen !=left
setheading="right"
snake_head=right
if event.key==locals.K_RIGHT and screen !=left
setheading="right"
snake_head=right
x+=30
po
screen.blit(background, (0, 0))
screen.blit(background, (x, y))
screen.blit(right, (240, 120))
......@@ -30,4 +47,5 @@ while True:
# 将果实画上去
screen.blit(food, (360, 300))
# 刷新画面
pygame.display.update()
\ No newline at end of file
pygame.display.update()
\ 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