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'),
index = 0
y=400
JumpState='running'
t=0
t=30
......@@ -42,24 +42,19 @@ while True:
if index == 5:
index = 0
if JumpState == 'up':
if y>150:
t+=0.8
if t >=10:
t=10
if t >0:
t-=1.7
y-=t
else:
y=150
t=0
JumpState = 'down'
if JumpState == 'down':
if y<400:
t+=0.8
if t >=10:
t=10
if t<30:
t+=2
y+=t
else:
t=400
t=0
y=400
t=30
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