Commit 35fb74ba by BellCodeEditor

save project

parent d7864b7f
Showing with 11 additions and 10 deletions
......@@ -23,7 +23,7 @@ class Player(pygame.sprite.Sprite):
self.rect = self.image.get_rect()
self.rect.x = 150
self.rest.y = 400
self.rect.y = 400
# 创建一个窗口
screen = pygame.display.set_mode((1000, 600))
......@@ -72,6 +72,7 @@ while True:
if jumpState == "up": # 起跳状态
if t > 0:
y -= t
wukong.rect.y = y
t -= 2
else:
jumpState = "down"
......@@ -87,15 +88,15 @@ while True:
# 将背景图画上去
shan_x -=2
if shan_x <-1000:
shan_x=0
screen.blit(background, (shan_x, 0)) # 远处背景
lu_x -=8
if lu_x <-1000:
lu_x=0
screen.blit(road, (lu_x, 500)) # 路
screen.blit(wukong, (150, y)) # 悟空
bg_x -=2
if bg_x <-1000:
bg_x=0
screen.blit(background, (bg_x, 0)) # 远处背景
road_x -=8
if road_x <-1000:
road_x=0
screen.blit(road, (road_x, 500)) # 路
screen.blit(wukong.image, (150, y)) # 悟空
if aa.rect.x <= 0-aa.rect.width: # 障碍物消失
# 创建障碍物对象
......
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