Commit a1a46e9a by BellCodeEditor

save project

parent a260b7d2
Showing with 18 additions and 4 deletions
......@@ -20,7 +20,8 @@ hero5 = pygame.image.load('hero5.png')
q=[hero1,hero2,hero3,hero4,hero5]
index = 0
w=0
jump0='running'
y=400
jump1='running'
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -30,13 +31,25 @@ while True:
if w%5==0:
w=0
if event.type==locals.KEYDOWN:
if get_event==K_SPACE
if event.key==locals.K_SPACE:
jump1='up'
if jump1=='up':
if y>150:
y-=5
else:
jump1='down'
if jump1=='down':
if y<400:
y+=5
else:
jump1='running'
# 将背景图画上去
screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
screen.blit(q[w], (150, 400))
screen.blit(q[w], (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