Commit e3ff45a8 by BellCodeEditor

save project

parent 1d8d73e2
Showing with 11 additions and 2 deletions
......@@ -10,6 +10,13 @@ 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=1000
self.rect.y=500-self.rect.height
# 创建一个窗口
screen = pygame.display.set_mode((1000, 600))
FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
......@@ -31,9 +38,11 @@ index = 0
y = 400
jumpState = "runing"
t = 30
bg_x = 0
road_y = 0
road_x = 0
time = 0
gamestate = True
block_list =pygame.sprite.Group()
obstacle = random.choice([bush,stone,cacti])
repr = obstacle.get_rect()
repr.x = 1000
......
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