Commit cd731034 by BellCodeEditor

save project

parent a331d1d0
Showing with 10 additions and 7 deletions
...@@ -25,24 +25,27 @@ while True: ...@@ -25,24 +25,27 @@ while True:
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
if event.type==locals.KEYDOWN: if event.type==locals.KEYDOWN:
if event.key==locals.K_SPACE: if c=='run':
c='up' if event.key==locals.K_SPACE:
c='up'
if c=='up': if c=='up':
if t>0: if t>=0:
y-=t y-=t
t-=2 t-=2
else: else:
c='down' c='down'
if c=='down': if c=='down':
if t<30: if t<=30:
y+=t y+=t
t+=2 t+=2
else: else:
c='run' c='run'
t=30
w=b[a] w=b[a]
a+=1 if c=='run':
if a>4: a+=1
a=0 if a>4:
a=0
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(road, (0, 500)) screen.blit(road, (0, 500))
......
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