Commit 3db93eb5 by BellCodeEditor

auto save

parent 52aa9634
Showing with 1 additions and 30 deletions
...@@ -15,36 +15,7 @@ hero =[ pygame.image.load('hero1.png'), ...@@ -15,36 +15,7 @@ hero =[ pygame.image.load('hero1.png'),
pygame.image.load('hero2.png'), pygame.image.load('hero2.png'),
pygame.image.load('hero3.png'), pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'), pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')] pyga)-1:
index = 0
y=400
z='running'
t=30
while True:
for event in pygame.event.get():
if event.type==locals.QUIT:
exit()
if event.type==locals.KEYDOWN:
if z=='running':
if event.key==locals.K_SPACE:
z='up'
if z=='up':
if t>0:
y-=t
t-=2
else:
z='down'
if z=='down':
if t <=30:
y+=t
t+=2
else:
z='running'
t=30
o=hero[index]
if z=='running':
index+=1
if index>len(hero)-1:
index=0 index=0
screen.blit(o, (150, y)) screen.blit(o, (150, y))
......
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