Commit 1b60f656 by BellCodeEditor

auto save

parent bf58f598
Showing with 37 additions and 2 deletions
...@@ -20,6 +20,7 @@ obstacle=random.choice([bush,stone,cacti]) ...@@ -20,6 +20,7 @@ obstacle=random.choice([bush,stone,cacti])
rect=obstacle.get_rect() rect=obstacle.get_rect()
rect.x=1000 rect.x=1000
rect.y=500-rect.height rect.y=500-rect.height
'''
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -63,4 +64,21 @@ while True: ...@@ -63,4 +64,21 @@ while True:
rect.x-=8 rect.x-=8
screen.blit(obstacle,(rect.x,rect.y)) screen.blit(obstacle,(rect.x,rect.y))
pygame.display.update() pygame.display.update()
FPS.tick(30) FPS.tick(30)
\ No newline at end of file '''
t=30
y=400
while True:
if j=="up":
if t>0:
y-=t
t-=2
else:
j="down"
print(y)
if j=="down":
if t<=30:
y+=t
t+=2
else:
j="runing"
\ No newline at end of file
t=30
y=400
while True:
if jumpState=="up":
if t>0:
y-=t
t-=2
else:
jumpState="down"
print(y)
if jumpState=="down":
if t<=30:
y+=t
t+=2
else:
jumpState="runing"
\ No newline at end of file
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