Commit 99e3b208 by BellCodeEditor

save project

parent da131497
Showing with 9 additions and 12 deletions
......@@ -22,30 +22,18 @@ while True:
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
if event.type==locals.KEYDOWN:
if event.key==locals.K_w and c!="down":
c="up"
d=up
if event.type==locals.KEYDOWN:
if event.key==locals.K_s and c!="up":
c="down"
d=do
if event.type==locals.KEYDOWN:
if event.key==locals.K_w and c!="left":
c="right"
d=ri
if event.type==locals.KEYDOWN:
if event.key==locals.K_w and c!="right":
c="left"
d=le
if c=="left":
x+=30
if c=="right":
x-=30
if c=="up":
y-=30
else:
y+=30
# 将背景图画上去\
b.append((x,y))
b.pop(0)
......@@ -58,6 +46,14 @@ while True:
# 将果实画上去
screen.blit(food, (360, 300))
if c=="left":
x+=30
if c=="right":
x-=30
if c=="up":
y-=30
else:
y+=30
# 刷新画面
pygame.display.update()
a.tick(1)
\ 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