Commit 578ecc37 by BellCodeEditor

save project

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