Commit baddda33 by BellCodeEditor

auto save

parent b9c60ac5
Showing with 8 additions and 4 deletions
......@@ -13,11 +13,11 @@ cacti = pygame.image.load('cacti.png') # 仙人掌
apple = pygame.image.load('bush.png') # 灌木丛
hero = [pygame.image.load('hero1.png'),pygame.image.load('hero2.png'),pygame.image.load('hero3.png'),pygame.image.load('hero4.png'),pygame.image.load('hero5.png')]
index = 0
pygame.display.set_caption("悟空跑酷")
pygame.display.set_caption("杨佳宁跑酷")
y=400
w="run"
t=30
stone_x=1000
while True:
for event in pygame.event.get():
......@@ -25,14 +25,17 @@ while True:
# 接收到退出事件后退出程序
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.K_SPACE:
w="up"
if w =="run":
if event.key == locals.K_SPACE:
w="up"
if w=='up':
if t>0:
y-=t
t-=2
else:
w="down"
if w=="down":
if t<=30:
y+=t
......@@ -45,6 +48,7 @@ while True:
index=index+1
if index>=5:
index=0
y=400
screen.blit(background,(0,0))
screen.blit(road, (0, 500))
......
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