Commit cc05d750 by BellCodeEditor

save project

parent a638d4c5
Showing with 5 additions and 5 deletions
......@@ -23,16 +23,16 @@ while True:
# 接收到退出事件后退出程序
exit()
if event.type == locals.KEYDOWN:
if event.key==locals.K_UP and c!="down":
if event.key==locals.K_w and c!="down":
c="up"
d=up
if event.key==locals.K_DOWN and c!="up":
if event.key==locals.K_s and c!="up":
c="down"
d=do
if event.key==locals.K_RIGHT and c!="left":
if event.key==locals.K_a and c!="left":
c="right"
d=ri
if event.key==locals.K_LEFT and c!="right":
if event.key==locals.K_d and c!="right":
c="left"
d=le
# 将背景图画上去\
......@@ -40,7 +40,7 @@ while True:
b.pop(0)
screen.blit(background, (0, 0))
# 将贪吃蛇画上去
for i in range(len(b)-1):
for i in range(len(b)):
screen.blit(d, (b[i]))
# 将贪吃蛇的身体画上去
if c=="left":
......
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