Commit 1a80303f by BellCodeEditor

save project

parent fc98777c
Showing with 8 additions and 5 deletions
......@@ -26,6 +26,7 @@ z=random.choice([stone,cacti,apple])
rect=z.get_rect()
rect.x=1000
rect.y=500-rect.height
t=30
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -37,13 +38,15 @@ while True:
jumpstate="up"
if jumpstate=="up":
if y>150:
y=y-5
if t>0:
y-=t
t=t-2
else:
jumpstate="down"
if jumpstate=="down":
if y<400:
y=y+5
if t<=30:
y+=t
t+=2
else:
jumpstate="runing"
......@@ -52,7 +55,7 @@ while True:
m=m+1
if m>4:
m=0
t=30
# 将背景图画上去
screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
......
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