Commit fee68c94 by BellCodeEditor

save project

parent 8c03c140
Showing with 19 additions and 8 deletions
......@@ -21,6 +21,7 @@ index = 0
pygame.display.set_caption("悟空酷跑")
c="run"
y=400
t=30
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -28,20 +29,30 @@ while True:
exit()
if event.type==locals.KEYDOWN:
if event.key==locals.K_SPACE:
c="up"
if c=="run":
c="up"
if c=="up":
if y>150:
y=y-5
if t>0:
y=y-t
t=t-2
else:
c="down"
if c=="down":
if y<400:
y=y+5
if t<=30:
y=y+t
t=t+2
else:
c="run"
a=a+1
if a==5:
a=0
t=30
print (y)
print(t)
if c=="up" or c=="down":
pass
else:
a=a+1
if a==5:
a=0
b=hero[a]
# 将背景图画上去
......
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