Commit 9ff44290 by BellCodeEditor

save project

parent 5e161c5c
Showing with 7 additions and 12 deletions
...@@ -21,7 +21,7 @@ hero = [pygame.image.load('hero1.png'), ...@@ -21,7 +21,7 @@ hero = [pygame.image.load('hero1.png'),
index = 0 index = 0
y=400 y=400
JumpState='running' JumpState='running'
t=0 t=30
...@@ -42,24 +42,19 @@ while True: ...@@ -42,24 +42,19 @@ while True:
if index == 5: if index == 5:
index = 0 index = 0
if JumpState == 'up': if JumpState == 'up':
if y>150: if t >0:
t+=0.8 t-=1.7
if t >=10:
t=10
y-=t y-=t
else: else:
y=150 y=150
t=0
JumpState = 'down' JumpState = 'down'
if JumpState == 'down': if JumpState == 'down':
if y<400: if t<30:
t+=0.8 t+=2
if t >=10:
t=10
y+=t y+=t
else: else:
t=400 y=400
t=0 t=30
JumpState ='running' JumpState ='running'
# 将背景图画上去 # 将背景图画上去
......
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