Commit 305479b2 by BellCodeEditor

save project

parent 8914c9fc
Showing with 9 additions and 16 deletions
...@@ -22,8 +22,6 @@ js='r' ...@@ -22,8 +22,6 @@ js='r'
y=400 y=400
t=40
pygame.display.set_caption('急急如律令') pygame.display.set_caption('急急如律令')
while True: while True:
...@@ -32,27 +30,22 @@ while True: ...@@ -32,27 +30,22 @@ while True:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
if event.type==locals.KEYDOWN: if event.type==locals.KEYDOWN:
if js=='r': if event.key==locals.K_SPACE:
if event.key==locals.K_SPACE: js='u'
js='u'
if js=='u': if js=='u':
if t > 0: if y > 10:
y-=t y-=100
t-=5
else: else:
js='d' js='d'
if js=='d': if js=='d':
if t <= 40: if y < 400:
y+=t y+=3
t+=5
else: else:
js='r' js='r'
t=40
wk = hero[index] wk = hero[index]
if js=='r': index += 1
index += 1 if index==5:
if index==5: index=0
index=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