Commit 578ecc37 by BellCodeEditor

save project

parent a1bdbb48
Showing with 3 additions and 5 deletions
...@@ -28,15 +28,13 @@ rect.y=500 - rect.height ...@@ -28,15 +28,13 @@ rect.y=500 - rect.height
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
if event.tpye==locals.KEYDOWN: if event.type == locals.KEYDOWN:
if jumpState =="runing": if jumpState =="runing":
if event.tpye==locals.K_SPACE: if event.key==locals.K_SPACE:
jumpState="up" jumpState="up"
if jumpState =="up": if jumpState =="up":
if t>0: if t>0:
y-=t y-=t
...@@ -60,7 +58,7 @@ while True: ...@@ -60,7 +58,7 @@ while True:
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(road, (0, 500)) screen.blit(road, (0, 500))
screen.blit(hero, (150, 400)) screen.blit(hero, (150,y))
if rect.x <= 0-rect.width: if rect.x <= 0-rect.width:
......
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