Commit ccab0e1c by BellCodeEditor

save project

parent ae8b4a82
Showing with 9 additions and 1 deletions
......@@ -10,6 +10,14 @@ class Block(pygame.sprite.Sprite):
self.rect.x=1000
self.rect.y=500-self.rect.height
pygame.init() # 初始化
class Player(pygame.sprite.Sprite):
def __init__(self,image):
super().__init__
self.image = image
self.rect = self.image.get_rect()
self.rect.x = 150
self.rect.x = 400
# 创建一个窗口
screen = pygame.display.set_mode((1000, 600))
FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
......@@ -73,7 +81,7 @@ while True:
lu_x=0
screen.blit(road, (lu_x, 500)) # 路
screen.blit(wukong, (150, y)) # 悟空
time +=
if aa.rect.x <= 0-aa.rect.width: # 障碍物消失
# 创建障碍物对象
aa=Block(bush,cacti,stone)
......
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