Commit c255fe1b by BellCodeEditor

save project

parent dca9a60a
Showing with 10 additions and 11 deletions
......@@ -28,12 +28,20 @@ while True:
if event.key==locals.K_s and c!="up":
c="down"
d=do
if event.key==locals.K_w and c!="left":
if event.key==locals.K_d and c!="left":
c="right"
d=ri
if event.key==locals.K_w and c!="right":
if event.key==locals.K_a and c!="right":
c="left"
d=le
if c=="left":
x+=30
elif c=="right":
x-=30
elif c=="up":
y-=30
else:
y+=30
# 将背景图画上去\
b.append((x,y))
b.pop(0)
......@@ -46,14 +54,6 @@ 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