Commit e62d4d4c by BellCodeEditor

auto save

parent 2ad8c285
Showing with 8 additions and 0 deletions
...@@ -23,6 +23,9 @@ y = 400 ...@@ -23,6 +23,9 @@ y = 400
jumpState = "runing" jumpState = "runing"
t = 30 t = 30
# stone_x = 1000 # stone_x = 1000
#障碍物随机 #障碍物随机
zhangaiwu = [stone,cacti,bush] zhangaiwu = [stone,cacti,bush]
obstacle = random.choice(zhangaiwu) obstacle = random.choice(zhangaiwu)
...@@ -33,6 +36,7 @@ rect.x = 1000 ...@@ -33,6 +36,7 @@ rect.x = 1000
#障碍物的高度,以道路的高度为参考,注意y坐标的正负 #障碍物的高度,以道路的高度为参考,注意y坐标的正负
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:
...@@ -93,6 +97,9 @@ while True: ...@@ -93,6 +97,9 @@ while True:
rect.y = 500 - rect.height rect.y = 500 - rect.height
rect.x -= 5 rect.x -= 5
screen.blit(obstacle, (rect.x,rect.y)) screen.blit(obstacle, (rect.x,rect.y))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) FPS.tick(60)
\ 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