Commit ea8ca038 by BellCodeEditor

auto save

parent 99910910
Showing with 12 additions and 5 deletions
...@@ -18,6 +18,7 @@ pygame.image.load("hero4.png"), ...@@ -18,6 +18,7 @@ pygame.image.load("hero4.png"),
pygame.image.load("hero5.png")] pygame.image.load("hero5.png")]
index = 0 index = 0
y = 400 y = 400
t=30
rupdown = 0 rupdown = 0
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -27,14 +28,20 @@ while True: ...@@ -27,14 +28,20 @@ while True:
if event.type==locals.KEYDOWN: if event.type==locals.KEYDOWN:
if event.key == locals.K_SPACE: if event.key == locals.K_SPACE:
rupdown=1 rupdown=1
if rupdown==1: if rupdown==1:
y-=5 if t>0:
if y < 150: y-=t
rupdown=2 t-=2
else:
rupdown =2
if rupdown==2: if rupdown==2:
y+=5 if t<=30:
if y>400: y+=t
t+=2
else:
rupdown=0 rupdown=0
t=30
wukong = hero[index] wukong = hero[index]
index+=1 index+=1
if index>4: if index>4:
......
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