Commit 6f34be29 by BellCodeEditor

save project

parent 8873374b
Showing with 7 additions and 2 deletions
......@@ -21,6 +21,7 @@ pygame.display.set_caption("
jumpS = "run"
y = 400
yy = 30
roadx = 0
while True:
for event in pygame.event.get():
......@@ -31,6 +32,7 @@ while True:
if event.key == locals.K_SPACE:
if jumpS == "run":
jumpS = "up"
print(roadx)
if jumpS == "up":
if yy > 0:
y-=yy
......@@ -46,11 +48,13 @@ while True:
yy = 30
# 将背景图画上去
screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
screen.blit(road, (roadx, 500))
screen.blit(hero[index], (150, y))
# 刷新画面
pygame.display.update()
FPS.tick(40)
if jumpS == "run":
index=(index+1)%5
roadx -= 5
if roadx == -1000:
roadx = 0
\ 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