Commit 83558747 by BellCodeEditor

save project

parent 14930c58
Showing with 10 additions and 2 deletions
...@@ -19,12 +19,20 @@ hero4 = pygame.image.load('hero4.png') ...@@ -19,12 +19,20 @@ hero4 = pygame.image.load('hero4.png')
hero5 = pygame.image.load('hero5.png') hero5 = pygame.image.load('hero5.png')
wukong = [hero1,hero2,hero3,hero4,hero5] wukong = [hero1,hero2,hero3,hero4,hero5]
index = 0 index = 0
indey=400
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.type == locals.KEYDOWN:
if event.key == locals.K_SPACE:
if indey>150:
for i in range(50):
indey-=5
else:
for i in range(50):
indey+=5
zaoxing = wukong[times] zaoxing = wukong[times]
times+=1 times+=1
if times>=5: if times>=5:
...@@ -32,7 +40,7 @@ while True: ...@@ -32,7 +40,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(zaoxing, (150, 400)) screen.blit(zaoxing, (150, indey))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
......
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