Commit 51e60870 by BellCodeEditor

save project

parent a7cfbc57
Showing with 9 additions and 5 deletions
......@@ -26,21 +26,24 @@ while True:
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
if erent.trype==locals.KEYDOWN:
if erent.key==K_SPACE:
if event.type==locals.KEYDOWN:
if event.key==locals.K_SPACE:
if jumpstate=="runing":
jumpstate="up"
if jumpstate=="up":
if y>150:
y=y-1
y=y-5
else:
jumpstate="down"
if jumpstate=="domn":
if jumpstate=="down":
if y<400:
y=y+5
else:
jumpstate="runing"
hero1=hero[m]
if jumpstate=="runing":
m=m+1
if m>4:
m=0
......@@ -48,7 +51,7 @@ while True:
# 将背景图画上去
screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
screen.blit(hero1, (150, 400))
screen.blit(hero1, (150, y))
# 刷新画面
pygame.display.update()
FPS.tick(60)
\ 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